home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
presto
/
presto10.lha
/
src
/
callstate.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-12-11
|
1KB
|
54 lines
#ifndef __presto__callstate_h__
#define __presto__callstate_h__
#define CS_MAXARGS 8
class Callstate {
PFany cs_func; // what we should call
#ifdef mips
Objany cs_arg;
#else
int cs_argc; // number of longwords to call
Objany cs_obj; // "this" arg (vax callg needs it here)
int cs_argvs[CS_MAXARGS]; // longwords to push on the call
int *cs_argvd; // if we need more than
// MAXARGS, shmalloc here.
int cs_len; // how much space available (in words)
#endif /* mips */
public:
Callstate()
{;} // satisfy compiler
~Callstate();
inline void init();
void reinit() // do nothing
{;}
#ifdef mips
void set(PFany f, Objany arg);
#else
void set(PFany f, int argc, int* argv);
#endif /* mips */
void call(int *sp = 0, Objany o = 0);
void print(ostream& = cout);
friend ostream& operator<<(ostream&, Callstate&);
};
//
// We don't want to have a constructor here, cuz it will get automatically
// called by Thread constructor, even when we are reusing old ones.
// The whole set "secret" mechanisms that initialize constructors are really
// a pain.
//
inline void
Callstate::init()
{
#ifdef mips
cs_arg = 0;
#else
cs_len = CS_MAXARGS; // storage optimized for this
cs_argvd = 0;
#endif
}
#endif /* __presto__callstate_h__ */